package com.cskaoyan.controller;

import com.cskaoyan.bean.VO.WxCollectListVo;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.service.WxCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:zhangjiaxin 商品收藏
 **/
@RestController
@RequestMapping("wx/collect")
public class WxCollectController {

    @Autowired
    WxCollectService wxCollectService;

    /**
     * @description: 进入收藏界面的数据显示
     * @methodName list
     * @param:  type
     * @param: page
     * @param: limit
     * @return:com.cskaoyan.bean.vo.BaseRespVo
     */
    @RequestMapping("list")
    public BaseRespVo list(Integer type,Integer page,Integer limit){
        CommonData list = wxCollectService.list(type, page, limit);
        return BaseRespVo.ok(list);
    }


    /**
     * @description: 添加收藏
     * @methodName addordelete
     * @param:  wxCollectListVo
     * @return:com.cskaoyan.bean.vo.BaseRespVo
     */
    @RequestMapping("addordelete")
    public BaseRespVo addordelete(@RequestBody WxCollectListVo wxCollectListVo){
        wxCollectService.addordelete(wxCollectListVo);
        return BaseRespVo.ok();
    }
}